from Base import message, intersect, SS_VALID
from DRG import MDCT_DRG

def group(record):
  adrg_zd = ["F42.000","F42.001","F42.003","F42.100","F42.101","F42.200","F42.800x001","F42.900","F42.901"]
  adrg_zd1 = []
  adrg_ss = []
  adrg_ss1 = []
  dept_list = []

  if True and record.zdList[0] in adrg_zd and (not record.ssList or not intersect(record.ssList[0],SS_VALID)):
    message('符合TY1入组条件，匹配规则：主诊断匹配')

    if MDCT_DRG.TY19_group(record):
      return 'TY19'
        
    return 'TY1'
  else:
    return ''
    
